/**
*创建环境代码
*@param {Object} envObj env对象
*/
export function createCodeEnv(envObj) {
  let result = ''
  for (let key in envObj) {
    result += `let ${key} = ${JSON.stringify(envObj[key])};`
  }
  return result
}

/**
*判断表达式是否为真
*@param {Object} envObj env对象
*/
export function isTrue(codeEnv, expressionCode) {
  let flag = false
  let result = codeEnv + `if(${expressionCode}){flag = true}`
  eval(result)
  return flag
}